# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nsntrace
pkgver=82.ed3532e
pkgrel=1
pkgdesc='Perform network trace of a single process by using network namespaces.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-sniffer')
url='https://github.com/jonasdn/nsntrace'
license=('GPL2')
depends=('dbus' 'docbook-xsl' 'glibc' 'libpcap' 'libgcrypt' 'libgpg-error' 'lz4'
         'libnl' 'libsystemd' 'libusb' 'libxslt' 'xz' 'iptables')
makedepends=('git' 'automake')
source=("git+https://github.com/jonasdn/nsntrace.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  ./autogen.sh
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

